<!--新增会员-->
<template>
  <section class="webview fixHeight">
    <el-scrollbar style="height:100%">
      <!--      经纪人-->
      
      
      <!--      开发商-->
      <el-form v-if="$route.query.type == 2" ref="form" :model="detail" label-width="100px" class="form">
        <el-form-item label="发布人">
          <el-input  v-model="detail.userName" />
        </el-form-item>
		<el-form-item label="发布时间">
		  <el-input  v-model="detail.createAt" />
		</el-form-item>
		<el-form-item label="评论数">
		  <el-input  v-model="detail.commentNum" />
		</el-form-item>
		<el-form-item label="点赞数">
		  <el-input  v-model="detail.goodNum" />
		</el-form-item>
        <el-form-item >
          <el-input  type="textarea" :rows="4" placeholder="请输入..." v-model="detail.content" />
        </el-form-item>
        <el-form-item>
         <el-button type="primary" @click="ok(detail.id)">通过</el-button>
         <el-button type="primary" @click="back(detail.id)">打回</el-button>
          <el-button @click="cancel">返回</el-button>
        </el-form-item>
      </el-form>
      
    </el-scrollbar>
  </section>
</template>
<script>
  import { bbsPostDetail,bbsPostUpdateStatus} from '@/api/api'
  export default {
    data() {
      return {
        detail: null
      }
    },
    created() {
      // 门店列表
	  var da=JSON.parse(this.$route.query.id)
	
	bbsPostDetail({
	  id: da.id
	}).then(data => {
		if(data.code == 200){
			this.detail=data.data
		}
	})
    },
    methods: {
		cancel(){
			this.$router.back()
		},
     ok(id){
     		  bbsPostUpdateStatus({
     		    id: id,
     		    status: 1
     		  }).then(data => {
     		    Is.tip('设置成功')
     		  this.$router.back()
     		  })
     },
     back(id){
     		  this.$prompt('请输入打回理由', '提示', {
     		            confirmButtonText: '确定',
     		            cancelButtonText: '取消'
     		          }).then(({ value }) => {
     					  bbsPostUpdateStatus({
     					    id: id,
     					    status:2,
     						noReason:value,
     					  }).then(data => {
     					    Is.tip('设置成功');
							this.$router.back()
     					  })
     		          }).catch(() => {
     		                 
     		          });
     		 
     },
      // 添加/编辑
    
    },
	}
</script>
